{template '../../header'}
{template '../../left'}

<div class="card">
    <div class="card-header">
        角色管理
    </div>
    <div class="card-body">
        <div class="row mb-3">
            <div class="col-12">
                <a href="/admin/rbac/role/edit" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加</a>
            </div>
        </div>
        <table class="table table-sm table-striped table-hover">
            <thead>
            <th>
                ID
            </th>
            <th>
                角色
            </th>
            <th>
                状态
            </th>
            <th>
                修改
            </th>
            <th>
                删除
            </th>	
            </thead>
            <tbody>                    
                {loop $rows $row}
                <tr>
                    <td>
                        {$row['id']}
                    </td>
                    <td>
                        {$row['title']}
                    </td>
                    <td>
                        {$row['state_title']}
                    </td>
                    <td>
                        <?php if ($row['id'] != 1) { ?>
                        <a href="/admin/rbac/role/edit?id={$row['id']}" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i></a>
                        <?php } ?>
                    </td>
                    <td>
                        <?php if ($row['id'] != 1) { ?>
                        <button type="button" class="btn btn-danger btn-sm" onclick="confirm('确定要删除吗？') && (location.href='/admin/rbac/role/remove?id={$row['id']}')"><i class="fa fa-trash-o"></i></button>
                        <?php } ?>
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
    </div>
</div>
{template '../../footer'}